from openpyxl import load_workbook
class Read():
    def __init__(self,path,sheetname):
        self.path = load_workbook(path)
        self.sheetname = self.path[sheetname]

    def getdata(self):
        datalist = []
        for line in self.sheetname:
            lis = []
            lis.append(line[0].value)
            lis.append(line[1].value)
            lis.append(line[2].value)
            lis.append(line[3].value)
            lis.append(line[4].value)
            lis.append(line[5].value)
            datalist.append(lis)
        datalist.pop(0)
        return datalist
if __name__ == '__main__':
    path = r"C:\Users\shuohan\Desktop\代码开发.xlsx"
    sheetname = "Sheet1"
    dy = Read(path,sheetname)
    print(dy.getdata())
